
/* Array Enumerator 
* Perform iteration on arrays
*/
var arrayEnum = BaseEnum.extend({
    name: "array",
    $index: -1,
    next: function() {
        if (this.$index < this.source.length - 1) {
            this.current = this.source[++this.$index];
            return true;
        }
        this.current = null;
        return false;
    },
    reset: function() {
        this.$index = -1;
        this.current = null;
    }
});
jsoq_regEnumClass("Array", arrayEnum);

jsoq.proto(Array, {
    toEnum: function() { return new arrayEnum(this); },
    toList: function() { return new jsoq.List(this); }
});
